<%@ page contentType="text/html; charset=UTF-8" buffer="16kb"%>
<%@ include file="../include/taglib.jsp"%>
<%
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragrma", "no-cache");
    response.setDateHeader("Expires", 0);
    Long resid = Long.parseLong(request.getParameter("id"));
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>linux综合性能页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta name="Keywords" content=" " />
<meta name="Description" content=" " />
<%@ include file="../include/common.jsp"%>
<%@ include file="../include/table.jsp"%>

<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/sub_menu.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/style/default/bsm/perf/listPage.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/charts/FusionCharts.js"></script>
	
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/charts/FusionCharts.jqueryplugin.js"></script>
	
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/common/Xslider.js"></script>
	
<script type="text/javascript" src="${pageContext.request.contextPath}/js/progressbar/jquery.progressbar.min.js"></script>


<script type="text/javascript">
	
	var iochart;
	function initIO(){
			if(typeof iochart == undefined || iochart==null){
				iochart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/MSSpline.swf?ChartNoDataText=没有数据","ioChart1", "100%", "150px", "0", "1" );
			}
		
			$.ajax({
				url : 'real-time!get2LineChart.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					childType:'1202030500000',
					propIds:'120203050000002,120203050000004,120203050000005,120203050000006'
				},
				success : function(dataset) {
					iochart.setJSONData(dataset);
					iochart.render("iolineChart");
				}
			});
	}
	
	
	var connchart;
	function initConn(){
		if(typeof connchart == undefined || connchart==null){
			connchart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/MSSpline.swf?ChartNoDataText=没有数据","connchart1", "100%", "150px", "0", "1" );
		}
	
		$.ajax({
			url : 'real-time!get2LineChart.action', // 
			type : 'POST',
			dataType : "json",
			data : {
				resId :<%=resid %>,
				childType:'1202030100000',
				propIds:'120203010000007,'
			},
			success : function(dataset) {
				connchart.setJSONData(dataset);
				connchart.render("connLineChart");
			}
		});
	}
	//
	
	
	var uptimeColChart;
	var fsColChartc;
	function initBaseInfo(){
			//基本信息
			$.ajax({
				url : 'real-time!getBaseInfo.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					propIds:'attr_110200000000001,prop_110203000000004,prop_110203000000003,prop_110203000000006,prop_110200000000002,prop_110200000000001'
				},
				success : function(data) {
					$('#attr_110200000000001').text(data.attr_110200000000001); //实例名
					$('#prop_110203000000004').text(data.prop_110203000000004); //版本
					$('#prop_110203000000003').attr('title',data.prop_110203000000003).text(data.prop_110203000000003)//
					$('#prop_110203000000006').text(data.prop_110203000000006); 
					$('#prop_110200000000002').text(data.prop_110200000000002);
					$('#prop_110200000000001').text(data.prop_110200000000001); 
					$('#resIp').text(data.ip);
				}
			});
			
			//缓冲池
			$.ajax({
				url : 'real-time!getBaseInfo.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					childType:'1202030400000',
					propIds:'prop_120203040000001,prop_120203040000002,prop_120203040000007,prop_120203040000008'
				},
				success : function(data) {
					$('#prop_120203040000001').progressBar(data.prop_120203040000001,{ showText: true, barImage: '${pageContext.request.contextPath}/style/default/bsm/perf/images/progressbg_yellow.gif'}); 
					$('#prop_120203040000002').progressBar(data.prop_120203040000002,{ showText: true, barImage: '${pageContext.request.contextPath}/style/default/bsm/perf/images/progressbg_yellow.gif'}); 
					$('#prop_120203040000007').progressBar(data.prop_120203040000007,{ showText: true, barImage: '${pageContext.request.contextPath}/style/default/bsm/perf/images/progressbg_yellow.gif'}); 
					$('#prop_120203040000008').progressBar(data.prop_120203040000008,{ showText: true, barImage: '${pageContext.request.contextPath}/style/default/bsm/perf/images/progressbg_yellow.gif'}); 
				}
			});
			
			//日志
			$.ajax({
				url : 'real-time!getHLineGauge.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					childType:'1202030600000',
					maxPropId:'120203060000002',
					usePropId:'120203060000001',
					unit:'B'
				},
				success : function(data) {
					if(typeof uptimeColChart == undefined || uptimeColChart == null){
						 uptimeColChart =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/HLinearGauge.swf?ChartNoDataText=没有数据","uptimeColChart11", "100%", "130", "0", "1" );
					}
					uptimeColChart.setJSONData(data);
					uptimeColChart.render("logChart");
				}
			});
			
			//表空间
			if(typeof fsColChartc == undefined || fsColChartc == null){
				fsColChartc =  new FusionCharts( "${pageContext.request.contextPath}/resources/charts/Column2D.swf","fsColChart11", "100%", "130", "0", "1" );
			}
			$.ajax({
				url : 'real-time!get2ColumnChart.action', // 
				type : 'POST',
				dataType : "json",
				data : {
					resId :<%=resid %>,
					detail:1,
					childType:'1202030300000',
					propIds:'120203030000003',
					top:'10',
					unit:''
					
				},
				success : function(data) {
					fsColChartc.setJSONData(data);
					fsColChartc.render("fsColChart");
				}
			});
	}
		
	$(document).ready(function() {
			initBaseInfo();
			initIO();
			initConn();
		setInterval('initBaseInfo()',60000);
	});
</script>

</head>
<body>
	<div class="column">
		<div class="col-main">
			<!--基本信息-->
			<div class="col-l-extra h-400">
			<h2 class="title-h2 m-0">基本信息</h2>
			<ul class="col-l-ul">
					<li><span class="col-l-ul-l" >数据库类别:</span><span 
								class="col-l-ul-r"><img src="${pageContext.request.contextPath}/style/default/bsm/perf/images/db24_24.png"/>&nbsp;&nbsp;DB2</span>
					</li>
					<li><span class="col-l-ul-l" >IP:</span><span id="resIp"
							class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >数据库名称:</span><span id="attr_110200000000001"
								class="col-l-ul-r"></span>
					</li>		
					<li><span class="col-l-ul-l" >版本:</span><span id="prop_110203000000004"
								class="col-l-ul-r"></span>
					</li>			
					<li><span class="col-l-ul-l" >路径:</span><span id="prop_110203000000003"
								class="col-l-ul-r col-l-ul-r-textell" style="width:70%;"></span>
					</li>			
					<li><span class="col-l-ul-l" >启动时间:</span><span id="prop_110203000000006"
								class="col-l-ul-r " ></span>
					</li>
					<li><span class="col-l-ul-l" >响应时间(ms):</span><span id="prop_110200000000002"
								class="col-l-ul-r"></span>
					</li>
					<li><span class="col-l-ul-l" >连接状态:</span><span id="prop_110200000000001"
								class="col-l-ul-r"></span>
					</li>
			   </ul>
			</div>
			<!--@end基本信息-->
			<div class="col-r-main">
				<div class="col-v-rate-extra" >
				  <h2 class="title-h2 m-0">日志空间</h2>
				  <div id="logChart"></div>
				</div>
				<!--@end基本信息-->
				<div class="col-v-rate-extra f-r">
				<h2 class="title-h2 m-0">缓冲池</h2>
					  	<ul class="col-l-ul">
							<li><span class="col-l-ul-l" style="width:60%;text-align:left;">总体读命中率:</span><span
								style="float:left" id="prop_120203040000001"></span>
							</li>
							<li><span class="col-l-ul-l" style="width:60%;text-align:left;">索引读命中率:</span><span
								style="float:left" id="prop_120203040000002"></span>
							</li>
							<li><span class="col-l-ul-l" style="width:60%;text-align:left;">排序溢出比率:</span><span
								style="float:left" id="prop_120203040000007"></span>
							</li>
							<li><span class="col-l-ul-l" style="width:60%;text-align:left;">锁定列表利用率:</span><span
								style="float:left" id="prop_120203040000008"></span>
							</li>
					</ul>
			    </div>
			     <div class="col-v-rate-extra" style="width:99%">
		            <h2 class="title-h2 m-0">表空间总页数 TOP10</h2>
			       <div id="fsColChart"></div>
			    </div>
		 </div>   
	  </div>
	</div>
	
	<div class="column b-1">
					<h2 class="title-h2 m-0">IO [当天趋势图]-[直接读操作速率,直接写操作速率,日志读操作速率,日志写操作速率]</h2>
						<div class="col-net-main p-99">
						    <div id="iolineChart"></div>
					    </div>
	</div>
	
	
	<div class="column b-1">
					<h2 class="title-h2 m-0">Connection [当天趋势图]-[本地连接数]</h2>
						<div class="col-net-main p-99">
						    <div id="connLineChart"></div>
					    </div>
	</div>
	
			 
	<div class="column" style="width:100%;height:5px;"></div>
</body>